﻿/*
    Copyright Rain-Soft co.2009 
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;

using Rmlife.Common;
using Rmlife.Model;
using Rmlife.Data;
using Rmlife.Cache;

namespace Rmlife.Site
{
    /// <summary>
    /// 缓存应用类
    /// </summary>
    public class Caches
    {
        /// <summary>
        /// 重置所有缓存
        /// </summary>
        public static void ReSetAllCache()
        {
            ReSetConfig();
            ReSysConfig();
            ReCompanyGroup();
            ReSetAnnouncementList();
            ReSetSimplifiedAnnouncementList();
            ReSetBureauList();
            ReSetSysDicList();
        }
        /// <summary>
        /// 重新设置:基本设置
        ///</summary>
        public static void ReSetConfig()
        {
            MyCache cache = MyCache.GetCacheService();
            cache.RemoveObject("/Site/Setting");
        }

        /// <summary>
        /// 重新设置:系统参数
        ///</summary>
        public static void ReSysConfig()
        {
            MyCache cache = MyCache.GetCacheService();
            cache.RemoveObject("/Site/SysConfigList");
        }
         /// <summary>
        /// 重新设置:单位分组
        ///</summary>
        public static void ReCompanyGroup()
        {
            MyCache cache = MyCache.GetCacheService();
            cache.RemoveObject("/Site/CompanyGroupInfo");
        }
        /// <summary>
        /// 重新设置指定时间内的公告列表
        ///</summary>
        public static void ReSetAnnouncementList()
        {
            MyCache cache = MyCache.GetCacheService();
            cache.RemoveObject("/Site/AnnouncementList");
        }

        /// <summary>
        /// 重新设置第一条公告
        ///</summary>
        public static void ReSetSimplifiedAnnouncementList()
        {
            MyCache cache = MyCache.GetCacheService();
            cache.RemoveObject("/Site/SimplifiedAnnouncementList");
        }

        /// <summary>
        /// 重新设置管理中心列表
        ///</summary>
        public static void ReSetBureauList()
        {
            MyCache cache = MyCache.GetCacheService();
            cache.RemoveObject("/Site/BureauList");
        }

        /// <summary>
        /// 重新字典列表
        ///</summary>
        public static void ReSetSysDicList()
        {
            MyCache cache = MyCache.GetCacheService();
            cache.RemoveObject("/Site/SysDicInfo");
        }
    }
}
